<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
	import="student.*,java.util.*"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>学员管理页</title>
</head>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
	$(function() {
		$("input[name=p]").keydown(function(e) {
			//alert(e.keyCode);//13
			if (e.keyCode == 13) {
				location = "SelectServlet?p=" + $(this).val();
			}
		}).blur(function() {
			location = "SelectServlet?p=" + $(this).val();
		});
	});
</script>
<body>
	<h1 style="color: blue; text-align: center">学员管理页</h1>

	<table border="1" align="center" width="80%" cellpadding="0" cellspacing="0">
		<tr style="background-color: pink">
			<td>学号</td>
			<td>姓名</td>
			<td>手机号</td>
			<td>年级</td>
			<td>删除</td>
			<td>修改</td>
			<td>详细信息</td>
		</tr>

		<c:forEach items="${LIST}" var="s">
		<tr>
			<td>${s.stuno}</td>
			<td>${s.sname}</td>
			<td>${s.telephone}</td>
			<td>${s.grade}</td>
			<td><a href="RemoveServlet?stuno=${s.stuno}" onclick="return confirm('真的要删除吗？');">删除</a></td>
			<td><a href="UpdateStuServlet?stuno=${s.stuno}">修改</a></td>
			<td><a href="ShowInfoServlet?stuno=${s.stuno}">详细信息</a></td>
		</tr>
		</c:forEach>
	</table>
	<p align="center">
		<a href="SelectServlet?p=1">首页</a>
		<c:if test="${PAGE_NO>1}">
		<a href="SelectServlet?p=${PAGE_NO-1}">上一页</a>
		</c:if>
		<input type="number" size="4" style="width: 30px" name="p" value="${PAGE_NO}" /> <span>${PAGE_NO}</span>
		<c:if test="${PAGE_NO<TotalPages}">
		<a href="SelectServlet?p=${PAGE_NO+1}">下一页</a>
		</c:if>
		<a href="SelectServlet?p=${TotalPages}">尾页</a>
	</p>
	<br />
	<p style="position: relative; left: 100px; font-size: 20px">新增功能</p>
	<p style="font-family: 楷体; font-size: 20px; position: relative; left: 100px;">
		<a href="ShowGradeServlet" style="text-decoration: none">增加新学员</a>
	</p>
	<p style="font-family: 楷体; font-size: 20px; position: relative; left: 100px;">
		<a href="studentLogin.jsp" style="text-decoration: none">查看登录状态</a>
	</p>
</body>
</html>